package main

import (
	"fmt"
	"unsafe"
	"strconv"
)

func main(){
    a := 18 
	
	var age byte = 18

	fmt.Println(a)
	fmt.Println(age)
	fmt.Printf("%T\n", a)
	fmt.Println(unsafe.Sizeof(age))


	var num1 float32 = 3.14
	var num2 float32 = 314E-2
	var num3 float32 = 314e-2
	var num4 float64 = 314E-2
	var num5 float64 = 314E+2

	fmt.Println(num1)
	fmt.Println(num2)
	fmt.Println(num3)
	fmt.Println(num4)
	fmt.Println(num5)

	var num6 = 3.14
	fmt.Printf("num1的类型为：%T\n", num6)

	var c1 byte = 'a'
	var c2 byte = '3'
	var c3 int16 = '中'
	fmt.Println(c1)
	fmt.Println(c2)
	fmt.Println(c3)

	fmt.Printf("%c\n", c1)
	fmt.Printf("%c\n", c2)
	fmt.Printf("%c\n", c3)

	fmt.Println("aaaaaaabbbbbbbb")
	fmt.Println("aaaaaaa\bbbbbbbbb")
	fmt.Println("aaaaaaa\tbbbbbbbb")
	fmt.Println("aaaaaaa\tbbbb\"bb\"bb")
	fmt.Println("aaaaaaabbbbb\\bbb")

	var flag01 bool = 1 > 2
	var flag02 bool = 1 < 2
	fmt.Println(flag01)
	fmt.Println(flag02)

	var str string = "hahahaahaha"
	str += "nishishabi"
	str += "iiiiii" + "aaaaaa" + "bbbbbb"
	fmt.Println(str)

	var str1 string = `
	fmt.Println("aaaaaaabbbbbbbb")
	fmt.Println("aaaaaaa\bbbbbbbbb")
	fmt.Println("aaaaaaa\tbbbbbbbb")
	fmt.Println("aaaaaaa\tbbbb\"bb\"bb")
	fmt.Println("aaaaaaabbbbb\\bbb")
    `
	fmt.Println(str1)

	var a1 string = "18"
	fmt.Printf("%v\n", a1)


	var a2 int
	var a3 float32
	var a4 float64
	var a5 bool
	var a6 string
	fmt.Println(a2)
	fmt.Println(a3)
	fmt.Println(a4)
	fmt.Println(a5)
	fmt.Println(a6)




	var b1 int = 18
	var b2 float32 = 3.14
	var b3 byte = 'a'
	var b4 bool = true

	var s1 string = fmt.Sprintf("%d", b1)
	fmt.Printf("%T, %q\n", s1, s1)
	fmt.Println(b1)
	fmt.Printf("%T\n", b1)
	
	var s2 string = fmt.Sprintf("%f", b2)
	fmt.Printf("%T, %q\n", s2, s2)
	fmt.Println(b2)
	fmt.Printf("%T\n", b2)

	var s3 string = fmt.Sprintf("%c", b3)
	fmt.Printf("%T, %q\n", s3, s3)
	fmt.Println(b3)
	fmt.Printf("%T\n", b3)
	
	var s4 string = fmt.Sprintf("%t", b4)
	fmt.Printf("%T, %q\n", s4, s4)
	fmt.Println(b4)
	fmt.Printf("%T\n", b4)

	var ss string = s1 + s2 + s3 + s4
	fmt.Println(ss)




	var x1 int = 18
	var x2 float64 = 3.14
	var x3 bool = false

	var ss1 string = strconv.FormatInt(int64(x1), 10)
	fmt.Printf("%T, %q\n", ss1, ss1)
	
	var ss2 string = strconv.FormatFloat(x2, 'f', 9, 64)
	fmt.Printf("%T, %q\n", ss2, ss2)
	
	var ss3 string = strconv.FormatBool(x3)
	fmt.Printf("%T, %q\n", ss3, ss3)

	var sss string = ss1 + ss2 + ss3
	fmt.Println(sss)




	var sss1 string = "true"
	var y1 bool
	y1, _ = strconv.ParseBool(sss1)
	fmt.Printf("%T, %v\n", y1, y1)

	var sss2 string = "18"
	var y2 int64
	y2, _ = strconv.ParseInt(sss2, 10, 64)
	fmt.Printf("%T, %v\n", y2, y2)
	
	var sss3 string = "3.14"
	var y3 float64
	y3, _ = strconv.ParseFloat(sss3, 64)
	fmt.Printf("%T, %v\n", y3, y3)
}